<template>
  <div class="container">
    <Sidebar />
    <div class="exhibit" :style="{ marginLeft: sidebarStore.isCollapse ? '60px' : '200px' }">
      <Navbar />
      <!-- 新增弹性内容容器 -->
      <main class="content-area">
        <RouterView />
      </main>
      <!-- 页脚始终位于底部 -->
      <AppFooter />
    </div>
  </div>
</template>

<script setup>
import Sidebar from '@/layout/components/Sidebar.vue'
import Navbar from '@/layout/Navbar.vue';
import { useSidebarStore } from "@/store/sidebar"
import AppFooter from '@/components/AppFooter.vue';

const sidebarStore = useSidebarStore()
</script>

<style scoped>
/* 外层容器 */
.container {
  min-height: 100vh;
  display: flex;
}

/* 主内容区域 */
.exhibit {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s ease 0.1s;
}

/* 内容区域 */
.content-area {
  flex: 1;
  min-width: 1200px;
  /* 关键属性：占据剩余空间 */
}
</style>